<!--
 * @Author: 高瑞寒 15932717091@163.com
 * @Date: 2022-05-17 22:48:58
 * @LastEditTime: 2022-05-18 22:02:01
 * @LastEditors: 高瑞寒 15932717091@163.com
 * @Description:
-->
<!--
 * @Author: 高瑞寒 15932717091@163.com
 * @Date: 2022-05-17 22:48:58
 * @LastEditTime: 2022-05-18 21:55:14
 * @LastEditors: 高瑞寒 15932717091@163.com
 * @Description:
-->
<template>
  <el-card>
    <el-table
      :data="permissionData"
      row-key="id"
      border
      default-expand-all
    >
      <el-table-column
        :label="$t('permission.name')"
        prop="permissionName"
      ></el-table-column>
      <el-table-column
        :label="$t('permission.mark')"
        prop="permissionMark"
      ></el-table-column>
      <el-table-column
        :label="$t('permission.desc')"
        prop="permissionDesc"
      ></el-table-column>
    </el-table>
  </el-card>
</template>

<script setup>
import { ref } from 'vue'
import { getAllPermission } from '@/api/role'
import { watchSwitchLang } from '@/utils/i18n'

// 初始化数据
const permissionData = ref([])
const init = async () => {
  permissionData.value = await getAllPermission()
}
init()
watchSwitchLang(init)

</script>

<style lang="scss" scoped></style>
